import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { URL, fileURLToPath } from 'node:url';

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [vue()],
  resolve: {
    alias: {
      '~': fileURLToPath(new URL('./', import.meta.url)),
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      '@http': fileURLToPath(new URL('./src/common/http/index.js', import.meta.url))
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        api: 'modern-compiler'
        // additionalData: '@import "@/styles/scss/global.scss";',
      }
    }
  },
  server: {
    port: 4001,
    host: '0.0.0.0',
    open: true,
    hmr: false,
    fs: {
      cachedChecks: false
    }
  },
  define: {
    'process.env': process.env
  }
});
